
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
  entry: {
    main: './src/index.js'
  },
  devtool: 'none',
  module: {
    rules: [{
      test: /\.js$/,
      exclude: /node_modules/,
      use: [{
        loader: 'babel-loader',
        options: {
          "presets": [["@babel/preset-env", {
            useBuiltIns: 'usage',
            targets:{
              edge: '17', // edge高于17的版本
              firefox: '60', // firefox 高于60的版本
              chrome: '67'  // chrome高于67的版本
            }
          }]]
        }
      }]
    }]
  },
  plugins: [new HtmlWebpackPlugin({
    template: './src/index.html'
  })],
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: '[name].js'
  },
  mode: 'development'
}